home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / jcool01.zip / DEFS.H < prev    next >
C/C++ Source or Header  |  1992-08-10  |  2KB  |  56 lines

  1. //
  2. //
  3. // Copyright (C) 1991 Texas Instruments Incorporated.
  4. //
  5. // Permission is granted to any individual or institution to use, copy, modify,
  6. // and distribute this software, provided that this complete copyright and
  7. // permission notice is maintained, intact, in all copies and supporting
  8. // documentation.
  9. //
  10. // Texas Instruments Incorporated provides this software "as is" without
  11. // express or implied warranty.
  12. //
  13. // This file contains common definitions, macros, and constants used by header
  14. // and source files under ICE.
  15. //
  16. // Updated: JAM 08/10/92 -- removed NULL and 'overload min/max'
  17. // Updated: JAM 08/10/92 -- now doesn't expect DOS <stdlib.h> to define min/max
  18.  
  19. #ifndef DEFSH                    // If no defs header file
  20. #define DEFSH
  21.  
  22. #ifndef BOOLEANH                // If Boolean type not defined
  23. #define BOOLEANH
  24. typedef int Boolean;                // Define Boolean data type
  25. #endif
  26.  
  27. #undef TRUE                    // ensure TRUE is defined
  28. #define TRUE (1)
  29.  
  30. #undef FALSE                    // ensure FALSE is defined
  31. #define FALSE (0)
  32.  
  33. #ifdef IV_INSTALLED            // Interviews define these already
  34. #include <InterViews/defs.h>
  35. #else
  36. // min --  Return the minimum of two long integers
  37. // Input:  Two long integers
  38. // Output: Smallest of two longs
  39.  
  40. inline char min (char a, char b) {return (a < b) ? a : b;}
  41. inline int min (int a, int b) {return (a < b) ? a : b;}
  42. inline long min (long a, long b) {return (a < b) ? a : b;}
  43. inline double min (double a, double b) {return (a < b) ? a : b;}
  44.  
  45. // max --  Return the maximum of two long integers
  46. // Input:  Two long integers
  47. // Output: Largest of two longs
  48.  
  49. inline char max(char a, char b) {return (a > b) ? a : b;}
  50. inline int max(int a, int b) {return (a > b) ? a : b;}
  51. inline long max(long a, long b) {return (a > b) ? a : b;}
  52. inline double max(double a, double b) {return (a > b) ? a : b;}
  53. #endif   // IV_INSTALLED
  54.  
  55. #endif DEFSH                // End #ifdef
  56.